home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / libnss-mdns.postrm < prev    next >
Text File  |  2008-04-18  |  1KB  |  49 lines

  1. #!/bin/sh
  2. set -e
  3. # Automatically added by dh_makeshlibs
  4. if [ "$1" = "remove" ]; then
  5.     ldconfig
  6. fi
  7. # End automatically added section
  8.  
  9.  
  10. log() {
  11.     echo "$*"
  12. }
  13.  
  14. remove_mdns() {
  15.     log "Checking NSS setup..."
  16.     # abort if /etc/nsswitch.conf does not exist
  17.     if ! [ -e /etc/nsswitch.conf ]; then
  18.         log "Could not find /etc/nsswitch.conf."
  19.         return
  20.     fi
  21.     perl -i -pe '
  22.         my @remove=(
  23.             "mdns4_minimal [NOTFOUND=return]",
  24.             "mdns4_minimal",
  25.             "mdns4",
  26.             "mdns6_minimal [NOTFOUND=return]",
  27.             "mdns6_minimal",
  28.             "mdns6",
  29.             "mdns_minimal [NOTFOUND=return]",
  30.             "mdns_minimal",
  31.             "mdns",
  32.         );
  33.         sub remove {
  34.             my $s=shift;
  35.             foreach my $bit (@remove) {
  36.                 $s=~s/\s+\Q$bit\E//g;
  37.             }
  38.             return $s;
  39.         }
  40.         s/^(hosts:)(.*)/$1.remove($2)/e;
  41.     ' /etc/nsswitch.conf
  42. }
  43.  
  44. action="$1"
  45.  
  46. if [ "$action" = remove ]; then
  47.     remove_mdns
  48. fi
  49.